<%-- 
    Document   : FPersona
    Created on : 05-sep-2013, 12:18:41
    Author     : pavel
--%>
<%@page import="sun.org.mozilla.javascript.internal.regexp.SubString" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="com.ptr.ptrsystem.dao.Lista"%>
<%@page import="com.ptr.ptrsystem.bean.*"%>
<%@page import="java.util.LinkedList"%>
<%@page language="java"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="Expires" content="0"/>
        <meta http-equiv="Pragma" content="no-cache"/>  
        <title> </title>
        <link rel='stylesheet' href='/RegCivil/css/estilos.css'>
        <script src='/RegCivil/js/jquery-2.0.2.js'></script>
        <script src='/RegCivil/js/funciones.js'></script>
        <script src='/RegCivil/js/returnmain.js'></script>
        <script type="text/javascript">
         {
            if(history.forward(1))
            location.replace(history.forward(1))
            }
        </script>
    </head>
    <SCRIPT LANGUAGE="JavaScript"> 
        function afirmacion() 
        { 
            open('/RegCivil/jsp/Lvinculo.jsp','Sizewindow', 'width=450,,height=300status=yes,menubar=0,scrollbars=0,toolbar=no,location=0,directories=0,left=300,top=100,resizable=no,border=1px')
        } 
    </SCRIPT>  
    <body>
        <form action="${pageContext.request.contextPath}/MantenimientoPersona" method="POST" name="" class="contacto">
            <table align="center" border="0" cellspacing="0" cellpadding="0" style="margin-top:0px ">
                <tr><td>                    
                        <fieldset style="alignment-baseline: central">
                            <legend style="border: 1px solid #dce0e3;background-color: #edf1f5">
                                REGISTRO DE NUEVO USUARIO</legend>
                            <table border="0">
                                <tr>
                                    <td>
                                        <fieldset><legend><label/>REGISTRO PERSONAL</legend>
                                            <table>
                                                <tr>
                                                    <TD><label/>Cui</td>
                                                        <%String cui = (String) request.getAttribute("CUI");
                                                            String na = (String) request.getAttribute("NA");
                                                            String nl = (String) request.getAttribute("NL");
                                                            String cd = (String) request.getAttribute("CD");
                                                            String dp = (String) request.getAttribute("DP");
                                                            String nd = (String) request.getAttribute("ND");
                                                            String g1 = (String) request.getAttribute("G");
                                                            String g = null;
                                                            if (g1.equals("M")) {
                                                                g = "MASCULINO";
                                                            } else if (g1.equals("F")) {
                                                                g = "FEMENINO";
                                                            }
                                                            //String f=(String)request.getAttribute("F");
                                                            String t1 = (String) request.getAttribute("T1");
                                                            String t2 = (String) request.getAttribute("T2");
                                                            String ec1 = (String) request.getAttribute("EC");
                                                            String ec = null;
                                                            if (ec1.equals("S")) {
                                                                ec = "SOLTERO";
                                                            } else if (ec1.equals("C")) {
                                                                ec = "CASADO";
                                                            } else if (ec1.equals("D")) {
                                                                ec = "DIVORCIADO";
                                                            } else if (ec1.equals("V")) {
                                                                ec = "VIUDO";
                                                            }
                                                            String cn = (String) request.getAttribute("CN");
                                                            String u = (String) request.getAttribute("U");
                                                            //String cep=(String)request.getAttribute("CEP");
                                                            //String cc=(String)request.getAttribute("CC");
%>
                                                    <td><input type="text" name="cui" size="8" style="width: 10.0em" value="<%=cui%>" maxlength="8">
                                                    </td>
                                                    <td><label/>Nro Acta</td>
                                                    <td><input type="text" name="nroacta" size="8" value="<%=na%>" style="width: 10.0em" maxlength="8">
                                                    </td>
                                                    <td><label/>Nro Libro</td>
                                                    <td><input type="text" name="nrolibro" size="8" value="<%=nl%>" style="width: 10.0em" maxlength="8">
                                                    </td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <fieldset>
                                            <legend><label/>DATOS PERSONALES</legend>
                                            <table>
                                                <tr>
                                                    <%
                                                        String pa = (String) request.getAttribute("PA");
                                                        String sa = (String) request.getAttribute("SA");
                                                        String ac = (String) request.getAttribute("AC");
                                                        String pn = (String) request.getAttribute("PN");
                                                        String datos = pa + " " + sa + " " + ac + " " + pn;
                                                    %>
                                                    <td colspan="4"><label/>APELLIDOS Y NOMBRES<br/>
                                                        <input type="text" name="pape" value="<%=datos%>" size="8" style="width: 30.0em"/></td>
                                                    <td><label/>Genero<br/>
                                                        <input type="text" name="genero" value="<%=g%>" style="width:10em"/>
                                                    </td>
                                                    <td><label/>Estado Civil<br/>
                                                        <input type="text" name="ecivil" value="<%=ec%>" style="width:10em"/>
                                                    </td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <fieldset>
                                            <legend><label/>LUGAR DE NACIMIENTO</legend>
                                            <%String unac = (String) request.getAttribute("unaci");
                                                String ubigeo = (String) request.getAttribute("U");
                                                String dep = ubigeo.substring(0, 2);
                                                String prov = ubigeo.substring(2, 4);
                                                String dist = ubigeo.substring(4, 6);
                                                String otro = null;
                                                if (ubigeo.length() == 8) {
                                                    otro = ubigeo.substring(6, 8);
                                                } else {
                                                    otro = "";
                                                }
                                            %>
                                            <table border="0">
                                                <tr>
                                                    <td><input type="text" name="dep" value="<%=dep%>" size="2" style="width: 1.0em" maxlength="2"></td>
                                                    <td><input type="text" name="prov" value="<%=prov%>" size="2" style="width: 1.0em" maxlength="2"></td>
                                                    <td><input type="text" name="dist" value="<%=dist%>" size="2" style="width: 1.0em" maxlength="2"></td>
                                                    <td><input type="text" name="otro" value="<%=otro%>" size="2" style="width: 1.0em" maxlength="2"></td>
                                                    <td><input type="text" name="lugnaci" value="<%=unac%>" size="8" style="width: 40.0em" maxlength="8">
                                                    </td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <fieldset>
                                            <legend><label/>LUGAR DE DOMICILIO</legend>
                                            <table border="0">
                                                <%String ud = (String) request.getAttribute("UD");
                                                    String d = ud.substring(0, 2);
                                                    String p = ud.substring(2, 4);
                                                    String di = ud.substring(4, 6);
                                                    String o = null;
                                                    if (ud.length() == 8) {
                                                        o = ud.substring(6, 8);
                                                    } else {
                                                        o = "";
                                                    }
                                                    String ubi = (String) request.getAttribute("udomicilio");
                                                %>
                                                <tr>
                                                    <td><input type="text" name="dep1" size="2" value="<%=d%>" style="width: 1.0em" maxlength="2"></td>
                                                    <td><input type="text" name="prov1" size="2" value="<%=p%>" style="width: 1.0em" maxlength="2"></td>
                                                    <td><input type="text" name="dist1" size="2" value="<%=di%>" style="width: 1.0em" maxlength="2"></td>
                                                    <td><input type="text" name="otro1" size="2" value="<%=o%>" style="width: 1.0em" maxlength="2"></td>
                                                    <td><input type="text" name="lugdomicilio" value="<%=ubi%>" size="8" style="width: 40.0em" maxlength="8">
                                                    </td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <fieldset>
                                            <legend><label>DIRECCION</label></legend>
                                            <table border="0">
                                                <tr>
                                                    <td>
                                                        <%String ndir = (String) request.getAttribute("ndir");%>
                                                        <input type="text" name="tdir" value="<%=ndir%>" style="width: 8em ">

                                                        <br/><label>Jr/Av/Cl</label></td>
                                                    <td><input type="text" name="direccion" value="<%=dp%>" size="8" style="width: 35em"><br/><label>Nombre Jr/Av/Cl</label></td>
                                                    <td><input type="text" name="nro" size="2" value="<%=nd%>" style="width: 5.0em"><br/><label>Numero</label></td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <fieldset>
                                            <legend><label>OTROS DATOS</label></legend>
                                            <table border="0">
                                                <tr>
                                                    <td><input type="text" name="tel1" value="<%=t1%>" size="2" style="width: 7.0em"><br/><label>Telefono 1</label></td>
                                                    <td><input type="text" name="tel2" size="2" value="<%=t2%>" style="width: 7.0em"><br/><label>Telefono 2</label></td>
                                                    <td>
                                                        <%String cnac = (String) request.getAttribute("CNAC");%>
                                                        <input type="text" name="TNacionalidad" value="<%=cnac%>" style="width: 17em">
                                                        <br/><label>Nacionalidad</label>
                                                    </td>
                                                    <td>
                                                        <%String cep = (String) request.getAttribute("CEP");%>
                                                        <input type="text" name="Trestriccion" value="<%=cep%>" style="width: 17em">
                                                        <br/><label>Restriccion</label>
                                                    </td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td>
                                </tr>

                            </table>
                        </fieldset>
                    </td></tr>
                <tr>
                    <td colspan="4">
                        <div align="center">                  
                            <fieldset style="alignment-baseline: central; height: 4em">
                                <legend style="border: 1px solid #dce0e3;background-color: #edf1f5">BOTONES DE MANTENIMIENTO</legend>
                                <table>
                                    <tr>
                                        <td><button type="submit" name="btn1" value="registrarnac"  class="boton">Registrar Acta Nac</button></td>
                                        <td><button type="reset" name="btn1" value="menu" onclick="main()">Menu Principal</button></td>
                                    </tr>
                                </table>
                            </fieldset>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <%String msj = (String) request.getAttribute("msj");
                            if (msj != null) {
                                if (msj == "0") {%>
                        <div>
                            <fieldset style="border-radius: 10px 10px 10px 10px; background-color: #e9ffed;border:1px solid #a2dcad">
                                <legend style="border-radius: 10px 10px 10px 10px; background-color: #e9ffed;border:1px solid #a2dcad"><img src="/RegCivil/imagenes/info.png"></legend>
                                <label>Alamcenamiento Satisfactorio</label>
                            </fieldset>
                        </div>
                        <%} else {%>
                        <div>
                            <fieldset style="border-radius: 10px 10px 10px 10px; background-color: #fff5f6;border:1px solid #f57269">
                                <legend style="border-radius: 10px 10px 10px 10px; background-color: #fff5f6;border:1px solid #f57269"><img src="/RegCivil/imagenes/exclamation.png"> </legend>
                                <label>Error en almacenar el registro ingresado</label>
                            </fieldset>
                        </div>
                        <%}%>
                        <%} else {%>
                        <div>
                            <fieldset style="border-radius: 10px 10px 10px 10px; background-color: #fffbe7;border:1px solid #ffe954">
                                <label style="color:#edd00c; font-size: 1.0em ">Informacion de Almacenamiento</label>
                            </fieldset>
                        </div>
                        <%}%>
                    </td>
                </tr>
            </table>
        </form>
    </body>
</html>